<template>
  <div>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item>
        <el-input v-model="formInline.name" placeholder="请输入姓名"/>
      </el-form-item>
      <el-form-item>
        <el-button type="success" @click="onSearch(formInline.name)">搜索</el-button>
      </el-form-item>
      <el-form-item>
        <el-button @click="onReset">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    name: "MySearch",
    data() {
      return {
        formInline: {
          name: ""
        }
      }
    },
    methods: {
      onSearch(name) {
        this.$bus.emit("searchByName", name);
      },
      onReset() {
        this.formInline.name = "";
      }
    }
  }
</script>

<style scoped>

</style>